<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>gozerlib.utils.timeutils &mdash; GOZERWAVE v0.1 BETA documentation</title>
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '0.1 BETA',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="GOZERWAVE v0.1 BETA documentation" href="../../index.html" />
    <link rel="next" title="gozerlib.utils.trace" href="trace.html" />
    <link rel="prev" title="gozerlib.utils.statdict" href="statdict.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="trace.html" title="gozerlib.utils.trace"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="statdict.html" title="gozerlib.utils.statdict"
             accesskey="P">previous</a> |</li>
        <li><a href="../../index.html">GOZERWAVE v0.1 BETA documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-gozerlib.utils.timeutils">
<h1>gozerlib.utils.timeutils<a class="headerlink" href="#module-gozerlib.utils.timeutils" title="Permalink to this headline">¶</a></h1>
<p>time related helper functions.</p>
<dl class="function">
<dt id="gozerlib.utils.timeutils.dmy">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">dmy</tt><big>(</big><em>ttime</em><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.dmy" title="Permalink to this definition">¶</a></dt>
<dd>return day month year as a string.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.elapsedstring">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">elapsedstring</tt><big>(</big><em>nsec</em>, <em>ywd=None</em><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.elapsedstring" title="Permalink to this definition">¶</a></dt>
<dd>given the number of seconds return a string of the elapsed time.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.getdaymonth">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">getdaymonth</tt><big>(</big><em>ttime</em><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.getdaymonth" title="Permalink to this definition">¶</a></dt>
<dd>return day-month of the given time.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.getdaymonthyear">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">getdaymonthyear</tt><big>(</big><em>ttime</em><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.getdaymonthyear" title="Permalink to this definition">¶</a></dt>
<dd>return day-month-year of the given time.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.hourmin">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">hourmin</tt><big>(</big><em>ttime</em><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.hourmin" title="Permalink to this definition">¶</a></dt>
<dd>return the hours:minutes of a unix timestamp.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.now">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">now</tt><big>(</big><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.now" title="Permalink to this definition">¶</a></dt>
<dd>return current time.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.striptime">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">striptime</tt><big>(</big><em>what</em><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.striptime" title="Permalink to this definition">¶</a></dt>
<dd>strip time indicators from string.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.strtotime">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">strtotime</tt><big>(</big><em>what</em><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.strtotime" title="Permalink to this definition">¶</a></dt>
<dd>convert string to time.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.today">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">today</tt><big>(</big><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.today" title="Permalink to this definition">¶</a></dt>
<dd>return time of 0:00 today.</dd></dl>

<dl class="function">
<dt id="gozerlib.utils.timeutils.uurminsec">
<tt class="descclassname">gozerlib.utils.timeutils.</tt><tt class="descname">uurminsec</tt><big>(</big><em>ttime</em><big>)</big><a class="headerlink" href="#gozerlib.utils.timeutils.uurminsec" title="Permalink to this definition">¶</a></dt>
<dd>return hours:minutes:seconds of the given time.</dd></dl>

<div class="section" id="code">
<h2>code<a class="headerlink" href="#code" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><pre>  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307</pre></td><td class="code"><div class="highlight"><pre><span class="c"># gozerlib/utils/timeutils.py</span>
<span class="c">#</span>
<span class="c">#</span>

<span class="sd">&quot;&quot;&quot; time related helper functions. &quot;&quot;&quot;</span>

<span class="c">## gozerlib imports</span>

<span class="kn">from</span> <span class="nn">exception</span> <span class="kn">import</span> <span class="n">handle_exception</span>

<span class="c">## basic imports</span>

<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">import</span> <span class="nn">calendar</span>

<span class="c">## vars</span>

<span class="n">leapfactor</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="mf">6</span><span class="o">*</span><span class="mf">60</span><span class="o">*</span><span class="mf">60</span><span class="p">)</span><span class="o">/</span><span class="nb">float</span><span class="p">(</span><span class="mf">365</span><span class="o">*</span><span class="mf">24</span><span class="o">*</span><span class="mf">60</span><span class="o">*</span><span class="mf">60</span><span class="p">)</span>
<span class="n">timere</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">&#39;(\S+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\d+)&#39;</span><span class="p">)</span>
<span class="n">bdmonths</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;Bo&#39;</span><span class="p">,</span> <span class="s">&#39;Jan&#39;</span><span class="p">,</span> <span class="s">&#39;Feb&#39;</span><span class="p">,</span> <span class="s">&#39;Mar&#39;</span><span class="p">,</span> <span class="s">&#39;Apr&#39;</span><span class="p">,</span> <span class="s">&#39;May&#39;</span><span class="p">,</span> <span class="s">&#39;Jun&#39;</span><span class="p">,</span> <span class="s">&#39;Jul&#39;</span><span class="p">,</span> <span class="s">&#39;Aug&#39;</span><span class="p">,</span> <span class="s">&#39;Sep&#39;</span><span class="p">,</span> <span class="s">&#39;Oct&#39;</span><span class="p">,</span> <span class="s">&#39;Nov&#39;</span><span class="p">,</span> <span class="s">&#39;Dec&#39;</span><span class="p">]</span>

<span class="k">def</span> <span class="nf">elapsedstring</span><span class="p">(</span><span class="n">nsec</span><span class="p">,</span> <span class="n">ywd</span> <span class="o">=</span> <span class="bp">None</span><span class="p">):</span>

    <span class="sd">&quot;&quot;&quot; given the number of seconds return a string of the elapsed time. &quot;&quot;&quot;</span>

    <span class="n">nsec</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">nsec</span><span class="p">))</span>
    <span class="n">year</span> <span class="o">=</span> <span class="mf">365</span><span class="o">*</span><span class="mf">24</span><span class="o">*</span><span class="mf">60</span><span class="o">*</span><span class="mf">60</span>
    <span class="n">week</span> <span class="o">=</span> <span class="mf">7</span><span class="o">*</span><span class="mf">24</span><span class="o">*</span><span class="mf">60</span><span class="o">*</span><span class="mf">60</span>
    <span class="n">day</span> <span class="o">=</span> <span class="mf">24</span><span class="o">*</span><span class="mf">60</span><span class="o">*</span><span class="mf">60</span>
    <span class="n">hour</span> <span class="o">=</span> <span class="mf">60</span><span class="o">*</span><span class="mf">60</span>
    <span class="n">minute</span> <span class="o">=</span> <span class="mf">60</span>
    <span class="n">nsec</span> <span class="o">-=</span> <span class="n">nsec</span> <span class="o">*</span> <span class="n">leapfactor</span>
    <span class="n">years</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">nsec</span><span class="o">/</span><span class="n">year</span><span class="p">)</span>
    <span class="n">nsec</span> <span class="o">-=</span> <span class="n">years</span><span class="o">*</span><span class="n">year</span>
    <span class="n">weeks</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">nsec</span><span class="o">/</span><span class="n">week</span><span class="p">)</span>
    <span class="n">nsec</span> <span class="o">-=</span> <span class="n">weeks</span><span class="o">*</span><span class="n">week</span>
    <span class="n">days</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">nsec</span><span class="o">/</span><span class="n">day</span><span class="p">)</span>
    <span class="n">nsec</span> <span class="o">-=</span> <span class="n">days</span><span class="o">*</span><span class="n">day</span>
    <span class="n">hours</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">nsec</span><span class="o">/</span><span class="n">hour</span><span class="p">)</span>
    <span class="n">nsec</span> <span class="o">-=</span> <span class="n">hours</span><span class="o">*</span><span class="n">hour</span>
    <span class="n">minutes</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">nsec</span><span class="o">/</span><span class="n">minute</span><span class="p">)</span>
    <span class="n">sec</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">nsec</span> <span class="o">-</span> <span class="n">minutes</span><span class="o">*</span><span class="n">minute</span><span class="p">)</span>   
    <span class="n">result</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">years</span> <span class="o">&gt;</span> <span class="mf">1</span><span class="p">):</span>
        <span class="n">result</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">years</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; years &quot;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">years</span> <span class="o">==</span> <span class="mf">1</span><span class="p">):</span>
        <span class="n">result</span> <span class="o">=</span> <span class="s">&quot;1 year &quot;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">weeks</span> <span class="o">&gt;</span> <span class="mf">1</span><span class="p">):</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">weeks</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; weeks &quot;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">weeks</span> <span class="o">==</span> <span class="mf">1</span><span class="p">):</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;1 week &quot;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">days</span> <span class="o">&gt;</span> <span class="mf">1</span><span class="p">):</span>
        <span class="k">if</span> <span class="n">ywd</span><span class="p">:</span>
            <span class="n">result</span> <span class="o">+=</span> <span class="s">&#39;and &#39;</span><span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">days</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; days&quot;</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">days</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; days &quot;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">days</span> <span class="o">==</span> <span class="mf">1</span><span class="p">):</span>
        <span class="k">if</span> <span class="n">ywd</span><span class="p">:</span>
            <span class="n">result</span> <span class="o">+=</span> <span class="s">&#39;and 1 day&#39;</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;1 day &quot;</span>

    <span class="k">if</span> <span class="n">ywd</span><span class="p">:</span>
        <span class="k">return</span> <span class="n">result</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">hours</span> <span class="o">&gt;</span> <span class="mf">1</span><span class="p">):</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">hours</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; hours &quot;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">hours</span> <span class="o">==</span> <span class="mf">1</span><span class="p">):</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;1 hour &quot;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">minutes</span> <span class="o">&gt;</span> <span class="mf">1</span><span class="p">):</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">minutes</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; minutes &quot;</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">minutes</span> <span class="o">==</span> <span class="mf">1</span><span class="p">):</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;1 minute &quot;</span>

    <span class="k">if</span> <span class="n">sec</span> <span class="o">==</span> <span class="mf">0</span><span class="p">:</span>
        <span class="k">if</span> <span class="n">result</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">result</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="mf">0</span>

    <span class="k">if</span> <span class="p">(</span><span class="n">sec</span> <span class="o">==</span> <span class="mf">1</span><span class="p">):</span>
        <span class="k">if</span> <span class="n">result</span><span class="p">:</span>
            <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;and 1 second &quot;</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">result</span> <span class="o">=</span> <span class="s">&quot;1 second&quot;</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="k">if</span> <span class="n">result</span><span class="p">:</span>
            <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;and &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">sec</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; seconds&quot;</span>
        <span class="k">else</span><span class="p">:</span> 
            <span class="n">result</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">sec</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; seconds&quot;</span>

    <span class="k">return</span> <span class="n">result</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>

<span class="k">def</span> <span class="nf">hourmin</span><span class="p">(</span><span class="n">ttime</span><span class="p">):</span>

    <span class="sd">&quot;&quot;&quot; return the hours:minutes of a unix timestamp. &quot;&quot;&quot;</span>

    <span class="n">result</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>
    <span class="n">timeres</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">(</span><span class="n">ttime</span><span class="p">)</span>

    <span class="k">if</span> <span class="n">timeres</span><span class="p">[</span><span class="mf">3</span><span class="p">]</span> <span class="o">&lt;</span> <span class="mf">10</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;0&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">3</span><span class="p">])</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">3</span><span class="p">])</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span>

    <span class="k">if</span> <span class="n">timeres</span><span class="p">[</span><span class="mf">4</span><span class="p">]</span> <span class="o">&lt;</span> <span class="mf">10</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;0&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">4</span><span class="p">])</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">4</span><span class="p">])</span>

    <span class="k">return</span> <span class="n">result</span>
	

<span class="k">def</span> <span class="nf">striptime</span><span class="p">(</span><span class="n">what</span><span class="p">):</span>

    <span class="sd">&quot;&quot;&quot; strip time indicators from string. &quot;&quot;&quot;</span>

    <span class="n">what</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">what</span><span class="p">)</span>
    <span class="n">what</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s">&#39;\d+-\d+-\d+&#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="n">what</span><span class="p">)</span>
    <span class="n">what</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s">&#39;\d+-\d+&#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="n">what</span><span class="p">)</span>
    <span class="n">what</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s">&#39;\d+:\d+&#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="n">what</span><span class="p">)</span>
    <span class="n">what</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s">&#39;\s+&#39;</span><span class="p">,</span> <span class="s">&#39; &#39;</span><span class="p">,</span> <span class="n">what</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">what</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>

<span class="k">def</span> <span class="nf">now</span><span class="p">():</span>

    <span class="sd">&quot;&quot;&quot; return current time. &quot;&quot;&quot;</span>

    <span class="k">if</span> <span class="n">time</span><span class="o">.</span><span class="n">daylight</span><span class="p">:</span>
        <span class="n">ttime</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">ctime</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="nb">int</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">timezone</span><span class="p">)</span> <span class="o">+</span> <span class="mf">3600</span><span class="p">)</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="n">ttime</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">ctime</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="nb">int</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">timezone</span><span class="p">))</span>
    <span class="k">return</span> <span class="n">ttime</span>

<span class="k">def</span> <span class="nf">today</span><span class="p">():</span>

    <span class="sd">&quot;&quot;&quot; return time of 0:00 today. &quot;&quot;&quot;</span>

    <span class="k">if</span> <span class="n">time</span><span class="o">.</span><span class="n">daylight</span><span class="p">:</span>
        <span class="n">ttime</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">ctime</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="nb">int</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">timezone</span><span class="p">)</span> <span class="o">+</span> <span class="mf">3600</span><span class="p">)</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="n">ttime</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">ctime</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="nb">int</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">timezone</span><span class="p">))</span>

    <span class="n">matched</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">timere</span><span class="p">,</span> <span class="n">ttime</span><span class="p">)</span>

    <span class="k">if</span> <span class="n">matched</span><span class="p">:</span>
        <span class="n">temp</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">matched</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">3</span><span class="p">),</span> <span class="n">matched</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">2</span><span class="p">),</span> <span class="n">matched</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">7</span><span class="p">))</span>
        <span class="n">timestring</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span><span class="n">temp</span><span class="p">,</span> <span class="s">&quot;</span><span class="si">%d</span><span class="s"> %b %Y&quot;</span><span class="p">)</span>
        <span class="n">result</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">mktime</span><span class="p">(</span><span class="n">timestring</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">result</span>

<span class="k">def</span> <span class="nf">strtotime</span><span class="p">(</span><span class="n">what</span><span class="p">):</span>

    <span class="sd">&quot;&quot;&quot; convert string to time. &quot;&quot;&quot;</span>

    <span class="n">daymonthyear</span> <span class="o">=</span> <span class="mf">0</span>
    <span class="n">hoursmin</span> <span class="o">=</span> <span class="mf">0</span>

    <span class="k">try</span><span class="p">:</span>
        <span class="n">dmyre</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">&#39;(\d+)-(\d+)-(\d+)&#39;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">what</span><span class="p">))</span>

        <span class="k">if</span> <span class="n">dmyre</span><span class="p">:</span>
            <span class="p">(</span><span class="n">day</span><span class="p">,</span> <span class="n">month</span><span class="p">,</span> <span class="n">year</span><span class="p">)</span> <span class="o">=</span> <span class="n">dmyre</span><span class="o">.</span><span class="n">groups</span><span class="p">()</span>
            <span class="n">day</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">day</span><span class="p">)</span>
            <span class="n">month</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">month</span><span class="p">)</span>
            <span class="n">year</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">year</span><span class="p">)</span>

            <span class="k">if</span> <span class="n">day</span> <span class="o">&lt;=</span> <span class="n">calendar</span><span class="o">.</span><span class="n">monthrange</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">)[</span><span class="mf">1</span><span class="p">]:</span>
                <span class="n">date</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">day</span><span class="p">,</span> <span class="n">bdmonths</span><span class="p">[</span><span class="n">month</span><span class="p">],</span> <span class="n">year</span><span class="p">)</span>
                <span class="n">daymonthyear</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">mktime</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span><span class="n">date</span><span class="p">,</span> <span class="s">&quot;</span><span class="si">%d</span><span class="s"> %b %Y&quot;</span><span class="p">))</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="k">return</span> <span class="bp">None</span>

        <span class="k">else</span><span class="p">:</span>
            <span class="n">dmre</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">&#39;(\d+)-(\d+)&#39;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">what</span><span class="p">))</span>

            <span class="k">if</span> <span class="n">dmre</span><span class="p">:</span>
                <span class="n">year</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">()[</span><span class="mf">0</span><span class="p">]</span>
                <span class="p">(</span><span class="n">day</span><span class="p">,</span> <span class="n">month</span><span class="p">)</span> <span class="o">=</span> <span class="n">dmre</span><span class="o">.</span><span class="n">groups</span><span class="p">()</span>
                <span class="n">day</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">day</span><span class="p">)</span>
                <span class="n">month</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">month</span><span class="p">)</span>

                <span class="k">if</span> <span class="n">day</span> <span class="o">&lt;=</span> <span class="n">calendar</span><span class="o">.</span><span class="n">monthrange</span><span class="p">(</span><span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">)[</span><span class="mf">1</span><span class="p">]:</span> 
                    <span class="n">date</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">day</span><span class="p">,</span> <span class="n">bdmonths</span><span class="p">[</span><span class="n">month</span><span class="p">],</span> <span class="n">year</span><span class="p">)</span>
                    <span class="n">daymonthyear</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">mktime</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span><span class="n">date</span><span class="p">,</span> <span class="s">&quot;</span><span class="si">%d</span><span class="s"> %b %Y&quot;</span><span class="p">))</span>
                <span class="k">else</span><span class="p">:</span>
                    <span class="k">return</span> <span class="bp">None</span>

        <span class="n">hmsre</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">&#39;(\d+):(\d+):(\d+)&#39;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">what</span><span class="p">))</span>

        <span class="k">if</span> <span class="n">hmsre</span><span class="p">:</span>
            <span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span> <span class="o">=</span> <span class="n">hmsre</span><span class="o">.</span><span class="n">groups</span><span class="p">()</span>
            <span class="n">h</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">h</span><span class="p">)</span>
            <span class="n">m</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">m</span><span class="p">)</span>
            <span class="n">s</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>

            <span class="k">if</span> <span class="n">h</span> <span class="o">&gt;</span> <span class="mf">24</span> <span class="ow">or</span> <span class="n">h</span> <span class="o">&lt;</span> <span class="mf">0</span> <span class="ow">or</span> <span class="n">m</span> <span class="o">&gt;</span> <span class="mf">60</span> <span class="ow">or</span> <span class="n">m</span> <span class="o">&lt;</span> <span class="mf">0</span> <span class="ow">or</span> <span class="n">s</span> <span class="o">&gt;</span> <span class="mf">60</span> <span class="ow">or</span> <span class="n">s</span> <span class="o">&lt;</span> <span class="mf">0</span><span class="p">:</span>
                <span class="k">return</span> <span class="bp">None</span>

            <span class="n">hours</span> <span class="o">=</span> <span class="mf">60</span> <span class="o">*</span> <span class="mf">60</span> <span class="o">*</span> <span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">hmsre</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">1</span><span class="p">)))</span>
            <span class="n">hoursmin</span> <span class="o">=</span> <span class="n">hours</span>  <span class="o">+</span> <span class="nb">int</span><span class="p">(</span><span class="n">hmsre</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">2</span><span class="p">))</span> <span class="o">*</span> <span class="mf">60</span>
            <span class="n">hms</span> <span class="o">=</span> <span class="n">hoursmin</span> <span class="o">+</span> <span class="nb">int</span><span class="p">(</span><span class="n">hmsre</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">3</span><span class="p">))</span>

        <span class="k">else</span><span class="p">:</span>
            <span class="n">hmre</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">&#39;(\d+):(\d+)&#39;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">what</span><span class="p">))</span>

            <span class="k">if</span> <span class="n">hmre</span><span class="p">:</span>
                <span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="n">m</span><span class="p">)</span> <span class="o">=</span> <span class="n">hmre</span><span class="o">.</span><span class="n">groups</span><span class="p">()</span>
                <span class="n">h</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">h</span><span class="p">)</span>
                <span class="n">m</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">m</span><span class="p">)</span>

                <span class="k">if</span> <span class="n">h</span> <span class="o">&gt;</span> <span class="mf">24</span> <span class="ow">or</span> <span class="n">h</span> <span class="o">&lt;</span> <span class="mf">0</span> <span class="ow">or</span> <span class="n">m</span> <span class="o">&gt;</span> <span class="mf">60</span> <span class="ow">or</span> <span class="n">m</span> <span class="o">&lt;</span> <span class="mf">0</span><span class="p">:</span>
                    <span class="k">return</span> <span class="bp">None</span>

                <span class="n">hours</span> <span class="o">=</span> <span class="mf">60</span> <span class="o">*</span> <span class="mf">60</span> <span class="o">*</span> <span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">hmre</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">1</span><span class="p">)))</span>
                <span class="n">hms</span> <span class="o">=</span> <span class="n">hours</span>  <span class="o">+</span> <span class="nb">int</span><span class="p">(</span><span class="n">hmre</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">2</span><span class="p">))</span> <span class="o">*</span> <span class="mf">60</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="n">hms</span> <span class="o">=</span> <span class="mf">0</span>

        <span class="k">if</span> <span class="ow">not</span> <span class="n">daymonthyear</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">hms</span><span class="p">:</span>
            <span class="k">return</span> <span class="bp">None</span>

        <span class="k">if</span> <span class="n">daymonthyear</span> <span class="o">==</span> <span class="mf">0</span><span class="p">:</span>
            <span class="n">heute</span> <span class="o">=</span> <span class="n">today</span><span class="p">()</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">heute</span> <span class="o">=</span> <span class="n">daymonthyear</span>

        <span class="k">return</span> <span class="n">heute</span> <span class="o">+</span> <span class="n">hms</span>

    <span class="k">except</span> <span class="ne">OverflowError</span><span class="p">:</span>
        <span class="k">return</span> <span class="bp">None</span>

    <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
        <span class="k">return</span> <span class="bp">None</span>

    <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">ex</span><span class="p">:</span>
        <span class="k">return</span> <span class="bp">None</span>

<span class="k">def</span> <span class="nf">uurminsec</span><span class="p">(</span><span class="n">ttime</span><span class="p">):</span>

    <span class="sd">&quot;&quot;&quot; return hours:minutes:seconds of the given time. &quot;&quot;&quot;</span>

    <span class="n">result</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>
    <span class="n">timeres</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">(</span><span class="n">ttime</span><span class="p">)</span>

    <span class="k">if</span> <span class="n">timeres</span><span class="p">[</span><span class="mf">3</span><span class="p">]</span> <span class="o">&lt;</span> <span class="mf">10</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;0&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">3</span><span class="p">])</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">3</span><span class="p">])</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span>

    <span class="k">if</span> <span class="n">timeres</span><span class="p">[</span><span class="mf">4</span><span class="p">]</span> <span class="o">&lt;</span> <span class="mf">10</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;0&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">4</span><span class="p">])</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">4</span><span class="p">])</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span>

    <span class="k">if</span> <span class="n">timeres</span><span class="p">[</span><span class="mf">5</span><span class="p">]</span> <span class="o">&lt;</span> <span class="mf">10</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="s">&quot;0&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">5</span><span class="p">])</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="n">result</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">timeres</span><span class="p">[</span><span class="mf">5</span><span class="p">])</span>

    <span class="k">return</span> <span class="n">result</span>


<span class="k">def</span> <span class="nf">getdaymonth</span><span class="p">(</span><span class="n">ttime</span><span class="p">):</span>

    <span class="sd">&quot;&quot;&quot; return day-month of the given time. &quot;&quot;&quot;</span>

    <span class="n">timestr</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">ctime</span><span class="p">(</span><span class="n">ttime</span><span class="p">)</span>
    <span class="n">result</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">timere</span><span class="p">,</span> <span class="n">timestr</span><span class="p">)</span>

    <span class="k">if</span> <span class="n">result</span><span class="p">:</span>
        <span class="k">return</span> <span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">3</span><span class="p">),</span> <span class="n">result</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">2</span><span class="p">))</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="k">return</span> <span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">getdaymonthyear</span><span class="p">(</span><span class="n">ttime</span><span class="p">):</span>

    <span class="sd">&quot;&quot;&quot; return day-month-year of the given time. &quot;&quot;&quot;</span>

    <span class="n">timestr</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">ctime</span><span class="p">(</span><span class="n">ttime</span><span class="p">)</span>
    <span class="n">result</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">timere</span><span class="p">,</span> <span class="n">timestr</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">result</span><span class="p">:</span>
        <span class="k">return</span> <span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">3</span><span class="p">),</span> <span class="n">result</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">2</span><span class="p">),</span> <span class="n">result</span><span class="o">.</span><span class="n">group</span><span class="p">[</span><span class="mf">7</span><span class="p">])</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="k">return</span> <span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">dmy</span><span class="p">(</span><span class="n">ttime</span><span class="p">):</span>

    <span class="sd">&quot;&quot;&quot; return day month year as a string. &quot;&quot;&quot;</span>

    <span class="n">timestr</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">ctime</span><span class="p">(</span><span class="n">ttime</span><span class="p">)</span>
    <span class="n">result</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">timere</span><span class="p">,</span> <span class="n">timestr</span><span class="p">)</span>

    <span class="k">if</span> <span class="n">result</span><span class="p">:</span>
        <span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">3</span><span class="p">),</span> <span class="n">result</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">2</span><span class="p">),</span> <span class="n">result</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mf">7</span><span class="p">))</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="k">return</span> <span class="bp">None</span>
</pre></div>
</td></tr></table></div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="">gozerlib.utils.timeutils</a><ul>
<li><a class="reference external" href="#code">code</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="statdict.html"
                                  title="previous chapter">gozerlib.utils.statdict</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="trace.html"
                                  title="next chapter">gozerlib.utils.trace</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../../_sources/gozerlib/utils/timeutils.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="trace.html" title="gozerlib.utils.trace"
             >next</a> |</li>
        <li class="right" >
          <a href="statdict.html" title="gozerlib.utils.statdict"
             >previous</a> |</li>
        <li><a href="../../index.html">GOZERWAVE v0.1 BETA documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2009, Bart Thate.
      Last updated on Nov 14, 2009.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
    </div>
  </body>
</html>